<%--
    Document   : User
    Created on : Oct 25, 2009, 10:09:20 PM
    Author     : Phong
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.sql.*" %>
<jsp:useBean id="old" class="DAO.Result" scope="request" />
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

        <link rel="stylesheet" href="css/style.css" />
        <link rel="stylesheet" href="css/front.css"  />
        <link rel="styleshett" href="css/admin.css" type="text/css" media="screen" />
        <title>Themes</title>
    </head>
    <body bgcolor="#154978">

        <table width="1024" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" align="center">
            <!--DWLayoutTable-->
            <tr>
                <td width="1024" height="157" valign="top" background="images/Banner.jpg">

                </td>
            </tr>
            <tr>
                <td height="463" valign="top">
                    <table width="100%" border="0" cellpadding="2" cellspacing="2">
                        <!--DWLayoutTable-->
                        <tr>
                            <td height="39" colspan="2" valign="top" background="images/button/bg_login.gif">
                            <%@include file="include/loginBar.jsp" %>	     </td>
                        </tr>
                        <tr>
                            <td width="179" height="537" valign="top">
                                <ul>
                                    <li><a href="InformationUser.jsp" style="">Thông tin tài khoản</a></li>
                                    <li><a href="Test.jsp">Kiểm Tra</a></li>
                                </ul></td>
                                <td width="831" align="left" valign="top" bgcolor="#CCCCCC">
                                <br>
                                <br>
                                <center style="color:red"><b>Bài Test bạn đã thi</b></center>
                                <br>
                                <br>
                                <br>
                                <%
            String[] charater = {"A", "B", "C", "D", "E", "F", "G", "H"};
            int j = 0;
            int check = 0;
            int idResult = Integer.parseInt(request.getParameter("id"));
            ResultSet rs = null;
            ResultSet rs1 = null;
            ResultSet rs2 = null;
            ResultSet rs3 = null;
            rs = old.selectQuestion(idResult);
            while (rs.next()) {
                int idQuestion = rs.getInt("QuestionID");
                rs1 = old.selectQuestionContent(idQuestion);
                while (rs1.next()) {
                                %>
                                <P style="font-size:18px"><%=rs1.getString("ContentQuestion")%></P>
                                <%
                                        }
                                        rs2 = old.selectAnswerAdmin(idQuestion);
                                        while (rs2.next()) {
                                            int idAdmin = rs2.getInt("AnswerID");
                                            rs3 = old.SelectAnswerUser(idResult);
                                            while (rs3.next()) {
                                                int idUser = rs3.getInt("AnswerID");
                                                if (idAdmin == idUser) {
                                                    check = idUser;
                                %>
                                <input disabled="true" type="checkbox" checked="checked" name="Choice" value="<%=rs2.getInt("AnswerID")%>"/><%=charater[j]%> . <%=rs2.getString("AnswerContent")%> <br>
                                <%
                                                }
                                            }
                                            if (check == idAdmin) {
                                %>
                                <input type="hidden" name="test" />
                                <%                    } else {
                                %>
                                <input disabled="true" type="checkbox" name="Choice" value="<%=rs2.getInt("AnswerID")%>"/><%=charater[j]%> . <%=rs2.getString("AnswerContent")%> <br>
                                <%
                                            }
                                            j++;
                                        }
                                        j = 0;
                                    }
                                %>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>



    </body>
</html>
